package com.sunjs.pay.service.impl;

import java.sql.Timestamp;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sunjs.model.Payment;
import com.sunjs.model.PaymentLog;
import com.sunjs.pay.dao.PaymentLogMapper;
import com.sunjs.pay.service.PaymentLogService;

@Service
public class PaymentLogServiceImpl implements PaymentLogService {
	
	@Autowired
	private PaymentLogMapper paymentLogMapper;

	@Override
	public int insertPaymentLog(PaymentLog paymentLog) {
		return paymentLogMapper.insertPaymentLog(paymentLog);
	}

	@Override
	public int insertPaymentLogByPayment(Payment payment,String msg) {
		PaymentLog paymentLog = new PaymentLog();
		paymentLog.setUserId(payment.getUserId());
		paymentLog.setOrderNo(payment.getOrderNo());
		paymentLog.setCreateTime( new Timestamp((new Date()).getTime()));
		return paymentLogMapper.insertPaymentLog(paymentLog);
	}

}
